import { defHttp } from '/@/utils/http/axios';
enum Api {
	exporturl="api/Customer/exportData",
}
/**
 * 导出api
 */
export const getExportUrl = Api.exporturl;
/** 定义接口请求 ， 接口地址可以写死 可以定义在 enumApi中 */
export function list(params) {
	if (params.StartEndTime) {
		const [startTime, endTime] = params.StartEndTime.split(',')
		params.startDate = startTime
		params.endDate = endTime
		delete params.StartEndTime
	}
	return new Promise((resolve, reject) => {
		defHttp.post({ url: 'api/Customer/list', params }).then(res => {
			console.log(res)
			resolve({ data: res.data })
		});
	})
}
export function save(data: any) {
	// return defHttp.post({ url: 'api/BasicData/saveProduct', data});
	return defHttp.post({ url: 'api/Customer/save', data: { 'info': [data] } });
}

export function del(id) {
	console.log('id',id)
	return defHttp.get({ url: `api/Customer/del?Id=${id}`, data: id });
}